<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="import" href="../header.html" id="page1">
		<!--标准mui.css-->
		
		<!--App自定义的css-->
		<!-- <link rel="stylesheet" type="text/css" href="../css/app.css" /> -->
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<link href="../../css/mui.picker.css" rel="stylesheet" />
		<link href="../../css/mui.poppicker.css" rel="stylesheet" />
		<style>
			h5 {
				margin: 5px 7px;
			}
		</style>
		<style>
			.mui-btn {
				font-size: 16px;
				padding: 8px;
				margin: 3px;
			}
			h5.mui-content-padded {
				margin-left: 3px;
				margin-top: 20px !important;
			}
			h5.mui-content-padded:first-child {
				margin-top: 12px !important;
			}
			.ui-alert {
				text-align: center;
				padding: 20px 10px;
				font-size: 16px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">查看详情</h1>
		</header>
		
		<div class="mui-content" id="rrapp">
			<form class="mui-input-group">
			<div class="mui-content-padded " >
			
				<div class="mui-input-row mui-content-padded">
					<label>巡检编号：</label>
					<input v-model="bussInspectionTask.businessNum" type="text" placeholder="巡检任务编号"  readonly="readonly"></input>
				</div>
			
				<div class="mui-input-row mui-content-padded">
					<label>巡检人：</label>
					<input v-model="bussInspectionTask.handlername" type="text"   readonly="readonly"></input>
				</div>
				
				<div class="mui-input-row mui-content-padded">
					<label>计划时间：</label>
					<input v-model="bussInspectionTask.startTime" type="text" placeholder="计划时间"  readonly="readonly"></input>
				</div>
				<div class="mui-input-row mui-content-padded">
					<label>任务名称：</label>
					<input v-model="bussInspectionTask.taskName" type="text" placeholder="巡检任务名称"  readonly="readonly"></input>
				</div>
				<div class="mui-input-row mui-content-padded">
					<label>设备：</label>
					<input v-model="bussInspectionTask.equipmentName" type="text"  readonly="readonly"></input>
				</div>
				<div class="mui-input-row mui-content-padded">
					<label>来源类型：</label>
					<input v-model="bussInspectionTask.sourceType" type="text"   readonly="readonly"></input>
				</div>
				<div class="mui-input-row mui-content-padded">
					<label>任务内容：</label>
					 <input v-model="bussInspectionTask.taskContent" type="text"   readonly="readonly"></input> 
					<!-- <textarea id="textarea" rows="5" placeholder="多行文本框"></textarea> -->
				</div>
				 <div v-if="bussInspectionTask.status=='1' || bussInspectionTask.status=='2'">
					 <div class="mui-input-row mui-content-padded">
					<label>接受时间：</label>
						 {{bussInspectionTask.planTime}}
					  </div>
				 </div>
				 
				  <!-- 结果信息 -->
			  <div v-if="bussInspectionTask.status=='2'">
				<div class="mui-input-row mui-content-padded">
				<label>完成时间：</label>
					{{bussInspectionTask.finishTime}}
				</div>
				<div class="mui-input-row mui-content-padded">
				<label>结果状态：</label>
					  <div v-if="bussInspectionTask.resultStatus==0" type="success"> 一切正常</div>
					  <div v-if="bussInspectionTask.resultStatus==1" type="warning"> 存在异常</div>
				 </div>
				  <div class="mui-input-row mui-content-padded">
				   <label>处理结果：</label>
					 {{bussInspectionTask.resultContent}}
				 </div>
				  
				  
				  <div class="mui-input-row mui-content-padded">
					<img v-for="(item, index) in resultFileIdsArr" :key="index" :src="loadImage(item)" 
						@click="downloadFile(item)" height="100px" style="max-width:100%;overflow:hidden;margin-right:10px;margin-bottom:10px">
					<!-- <iframe v-show="false" :src="ifrUrl"></iframe> -->
				  </div> 
			  </div>
				
				
					
					
					<div class="mui-button-row">
						<button type="button" class="mui-btn mui-btn-danger" @click="fh">返回</button>
					</div>
				<!-- </form> -->
				
				
				
			</div>
					</form>
		</div>

		<!--<script src="../js/mui.picker.min.js"></script>-->
		<script src="../../js/mui.picker.js"></script>
		<script src="../../js/mui.poppicker.js"></script>
		<script src="../../js/city.data.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
		<script>
			(function($, doc) {
				$.init();
					
				
				$.ready(function() {
					console.log('11')
					console.log(T.p("gid"))
			   
				
			})(mui, document);
			})
			
			
			var vm = new Vue({
				el:'#rrapp',
				data:{
					showList: true,
					title: null,
					bussInspectionTask: {
					  id: 0,
					  farmlandInfoIds: '',
					  resultFileIds: '',
					  parentName:'',
					  handler: '',
					  inspectionPlanId: '',
					   deptId: '',
					  deptName:'',
					  businessNum: '',
					  taskName: '',
					  taskContent: '',
					  startTime: '',
					  planTime: '',
					  resultStatus: '',
					  resultContent: '',
					  status: '',
					  sourceType: '',
					  createId: '',
					  createName: '',
					  createTime: '',
					  updateId: '',
					  updateTime: '',
					  updateName: '',
					  version: '',
					  gcFlag: '',
					  planTime: '',
					  resultFileIdsArr:[]
						
					},
					
				},
				methods: {
					getm: function () {
						console.log(T.p("gid"))
						var id = T.p("gid");
						 mui.get(baseUrl+"/buss/bussinspectiontask/info/"+id,function(data,status){
							console.log(data.bussInspectionTask)
							vm.bussInspectionTask = data.bussInspectionTask
							vm.resultFileIdsArr = [];
							  if(data.bussInspectionTask.resultFileIds){
								vm.resultFileIdsArr = vm.bussInspectionTask.resultFileIds.split(',')
							  }
						});
						
					},
					loadImage(bytearrayId){
						  return  baseUrl+'/fileAction/loadFile?bytearrayId='+bytearrayId;
					},
					save : function(){
						vm.insIndetailsugtion = {
							handler:vm.handler,
							equipmentId:vm.equipmentId,
							type:vm.type,
							content:vm.content,
							gradeNum:vm.gradeNum
						}
						mui.ajax(baseUrl+'/buss/bussinspectiontask/save',{
							//data:{
								data:JSON.stringify(vm.insIndetailsugtion
								),
							//},
							//dataType:'json',//服务器返回json格式数据
							contentType: "application/json",
							type:'post',//HTTP请求类型
							//headers:{'Content-Type':'application/json'},	              
							success:function(data){
								if(data.code == 0){
									mui.toast('添加成功', {
										duration: 'long',
										type: 'div'
									})
								}else{
									mui.toast('添加失败', {
										duration: 'long',
										type: 'div'
									})
								}
								
							},error: function(xhr, type, errorThrown) {
								//异常处理；
								mui.toast('添加失败', {
									duration: 'long',
									type: 'div'
								})
							}
					})
					},
					fh:function(){
					   console.log('返回')
					   mui.openWindow({
						url: "xunjian.html",
						createNew:true
						});
/* 					   mui.openWindow({
						url: "A页面",
						createNew:true
						});
 */					}
				},
				mounted:function(){
					this.getm();
				}
			});
			

		</script>
	</body>

</html>